package com.supermap.localization.impl;

import java.util.ArrayList;
import java.util.List;

import com.supermap.localization.api.SamplesSaver;
import com.supermap.localization.commontypes.SampleInfo;

public class SampleSaveManager {
    private List<SamplesSaver> savers;

    public void add(SamplesSaver saver) {
        if (savers == null) {
            savers = new ArrayList<>();
        }
        savers.add(saver);
    }

    public void save(List<SampleInfo> infos) {
        for (int i = 0; i < savers.size(); i++) {
            SamplesSaver currentSaver = savers.get(i);
            currentSaver.saveSamples(infos);
        }
    }

}
